#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char arr[110];
	while (cin >> arr)
	{
		int len = strlen(arr);
		int max = -21;
		for (int i = 0; i < len; i++)
		{
			if (arr[i] - '0' > max)
			{
				max = arr[i] - '0';
			}
		}
		for (int i = 0; i < len; i++)
		{
			if (arr[i] - '0' == max) {
				cout << arr[i] << "(max)";
			}
			else {
				cout << arr[i];
			}
		}
		cout << endl;
	}
	return 0;
}